<script setup lang="ts">
  import { ref } from 'vue'
  import type { Node } from '@vue-flow/core'
  import BaseNode from '../base-node/index.vue'
  import ItemList from '../components/item-list.vue'

  const props = defineProps<Node>()

  const nodeInfo = ref<Node>({
    ...props,
    id: '1',
    type: 'begin',
    data: {
      label: '开始',
      icon: 'material-symbols:not-started-outline',
      content: [
        {
          name: 'group',
          isRequired: true,
          type: 'string',
          id: 1,
        },
        {
          name: 'age',
          isRequired: true,
          type: 'number',
          id: 2,
        },
        {
          name: 'agSEXe',
          isRequired: false,
          type: 'string',
          id: 3,
        },
      ],
      desc: '你好，我是开始节点，我只能有1个测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试',
      ...props.data,
    },
    style: { background: 'rgb(85,217,245)' },
  })
</script>

<template>
  <BaseNode :meta="nodeInfo">
    <div class="box_shirt p-2">
      <ItemList :list="nodeInfo.data.content" />
    </div>
  </BaseNode>
</template>
<style scoped lang="less">
  .box {
    min-width: 120px;
    height: 40px;
    line-height: 40px;
    text-align: center;
  }
</style>
